<?php
/**
 * 传递一个id返回该分类所有的父级分类
 * @param  [type] $array [description]
 * @param  [type] $id    [description]
 * @return [type]        [description]
 */
function get_all_parent($array,$id){
	$arr = array();
	foreach ($array as $v) {
		if($v['id'] == $id){
			$arr[] = $v;
			$arr = array_merge(get_all_parent($array,$v['pid']),$arr);
		}
	}
	return $arr;
}